Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed nested type resolution #1384

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

till0xff
Copy link
Contributor

Fixed nested type resolution in an extension with a global type name in the same module.

Example

File Moya.xcframework/ios-arm64_x86_64-simulator/Moya.framework/Modules/Moya.swiftmodule/arm64-apple-ios-simulator.swiftinterface

final public class NetworkActivityPlugin : Moya.PluginType {
  public typealias NetworkActivityClosure = (_ change: Moya.NetworkActivityChangeType, _ target: Moya.TargetType) -> Swift.Void
  public init(networkActivityClosure: @escaping Moya.NetworkActivityPlugin.NetworkActivityClosure)
  final public func willSend(_ request: Moya.RequestType, target: Moya.TargetType)
  final public func didReceive(_ result: Swift.Result<Moya.Response, Moya.MoyaError>, target: Moya.TargetType)
  @objc deinit
}

//...

extension Moya.NetworkLoggerPlugin {
  public struct Configuration {
    public typealias OutputType = (_ target: Moya.TargetType, _ items: [Swift.String]) -> Swift.Void
    public var formatter: Moya.NetworkLoggerPlugin.Configuration.Formatter
    public var output: Moya.NetworkLoggerPlugin.Configuration.OutputType
    public var logOptions: Moya.NetworkLoggerPlugin.Configuration.LogOptions
    public init(formatter: Moya.NetworkLoggerPlugin.Configuration.Formatter = Formatter(), output: @escaping Moya.NetworkLoggerPlugin.Configuration.OutputType = defaultOutput, logOptions: Moya.NetworkLoggerPlugin.Configuration.LogOptions = .default)
    public static func defaultOutput(target: Moya.TargetType, items: [Swift.String])
  }
}

Sourcery fails with error:

SourceryRuntime/ParserResultsComposed.swift:151: Assertion failed: Type Moya.NetworkLoggerPlugin.Configuration should be extension

@till0xff till0xff changed the title Fixed nested type resolution WIP: Fixed nested type resolution Nov 13, 2024
@till0xff till0xff changed the title WIP: Fixed nested type resolution Fixed nested type resolution Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant